package com.aiiju.core.test;


import java.io.File;

import org.junit.Test;

import com.bole.resumeparser.document.impl.DocHtml51jobResumeParser;
import com.bole.resumeparser.models.TextResumeData;
import com.tongdainfo.common.parser.HtmlParser;
import com.tongdainfo.common.parser.IParser;
import com.tongdainfo.common.parser.TxtParser;

public class Html51Demo {
	
	@Test
	public void testqq2() throws Exception {
		String filePath= "C:\\Users\\aiju\\Desktop\\测试简历\\51.txt";
		File file = new File(filePath);
		/*boolean exists = file.exists();
		System.out.println(exists);*/
		
		IParser parse  = new TxtParser();
		String readText = parse.readText(file, "GBK");
		System.out.println(readText);
		
//		HtmlParser.
		/*String htmlToString = HtmlToString.htmlToString(filePath);
		System.out.println(htmlToString);*/
	}
	@Test
	public void testqq1() throws Exception {
		String html = this.getString2();
		String url = "http://www.51job.com/";
		DocHtml51jobResumeParser jobResumeParser = new DocHtml51jobResumeParser(html,url);
		TextResumeData parseResult = jobResumeParser.parse();
		System.out.println(parseResult);
	
	}
	
	private String getString() throws Exception  {
		String filePath= "C:\\Users\\aiju\\Desktop\\测试简历\\51.txt";
		File file = new File(filePath);
		/*boolean exists = file.exists();
		System.out.println(exists);*/
		
		IParser parse  = new TxtParser();
		String readText = parse.readText(file, "GBK");
		System.out.println(readText);
		
		return readText;
	}
	private String getString2() throws Exception  {
		String filePath= "C:\\Users\\aiju\\Desktop\\1.html";
		File file = new File(filePath);
		/*boolean exists = file.exists();
		System.out.println(exists);*/
		
		IParser parse  = new TxtParser();
		String readText = parse.readText(file, "GBK");
		System.out.println(readText);
		
		return readText;
	}

}
